package relax.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import relax.entity.PayOrder;
import relax.mapper.PayMapper;
import relax.service.PayService;

@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
    private PayService payService;

    @Autowired
    private PayMapper payMapper;


    @PostMapping("/orderPay")
    public PayOrder orderPay(@RequestBody PayOrder order) {
        return payService.orderPay(order);
    }


    @PostMapping("updateForSeata")
    void updateForSeata(@RequestParam("id") Integer id) {
        System.out.println("pay 服务的updateForSeata方法被调用");
        Integer integer = payMapper.updateForSeata(id, System.currentTimeMillis() + "");
    }
}
